package com.psak.cudaphrasal.server;

import org.springframework.context.ApplicationContext;

import com.psak.cudaphrasal.server.service.chunk.ChunkCreatorService;
import com.psak.cudaphrasal.server.service.inputfile.InputFileManagementService;
import com.psak.cudaphrasal.server.service.result.ResultManagementService;
import com.psak.cudaphrasal.server.service.task.TaskDispatcherService;

public class ServiceLocator {
	public static ChunkCreatorService getChunkCreatorService(
			ApplicationContext context) {
		return context
				.getBean("chunkCreatorService", ChunkCreatorService.class);
	}

	public static InputFileManagementService getInputFileManagementService(
			ApplicationContext context) {
		return context.getBean("inputFileManagementService",
				InputFileManagementService.class);
	}

	public static ResultManagementService getResultManagementService(
			ApplicationContext context) {
		return context.getBean("resultManagementService",
				ResultManagementService.class);
	}

	public static TaskDispatcherService getTaskDispatcherService(
			ApplicationContext context) {
		return context.getBean("taskDispatcherService",
				TaskDispatcherService.class);
	}

}
